package com.librarydemo.demo.service;

import com.librarydemo.demo.entity.Book;
import com.librarydemo.demo.entity.BorrowRecord;
import com.librarydemo.demo.entity.User;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface UserService {
    //登陆验证
    User loginCheck(String username, String password) ;

    //注册时，用户名唯一性验证
    boolean isNameExist(String username) ;

    //注册
    boolean register(User user) ;

    //更新用户头像
    boolean UpdatePic(int uid, String picture) ;

    //通过uid获取用户的信息
    User getById(int uid) ;

    //修改密码
    boolean rePassword(int uid, String password) ;

    //获取用户头像
    String getPicture(int uid) ;

    //借阅图书
    boolean borrowBook(int uid, int bid) ;

    //归还图书
    boolean returnBook(int uid, int bid);

    //获取所有的借阅记录
    List<BorrowRecord> getAllBorrowRecord(int uid);

    //搜索图书
    List<Book> getBooks(String name, String author, String publisher, String catalog);
}
